<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增渠道包管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-package-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">渠道商Id：</label>
                <div class="col-sm-8">
                    <input name="channelId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否实时统计：0否，1是：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'statRealTime_' + dict.dictCode}" name="statRealTime" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'statRealTime_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">游戏Id：</label>
                <div class="col-sm-8">
                    <input name="gameId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">渠道号：</label>
                <div class="col-sm-8">
                    <input name="cid" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">合作方式CPA或CPS：</label>
                <div class="col-sm-8">
                    <select name="model" class="form-control m-b" th:with="type=${@dict.getType('cwsk_coopera_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">渠道分成比例，保存小数：</label>
                <div class="col-sm-8">
                    <input name="rate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通道费：</label>
                <div class="col-sm-8">
                    <input name="slottingFee" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">注册单价：</label>
                <div class="col-sm-8">
                    <input name="unitPrice" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否显示单价：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('cwsk_special_power')}">
                        <input type="radio" th:id="${'displayUnitPrice_' + dict.dictCode}" name="displayUnitPrice" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'displayUnitPrice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">给数比例，用于CPA：</label>
                <div class="col-sm-8">
                    <input name="countRate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">合作游戏的版本号：</label>
                <div class="col-sm-8">
                    <input name="packageVersion" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">0为试合作渠道，1为正式渠道：</label>
                <div class="col-sm-8">
                    <select name="packageStatus" class="form-control m-b" th:with="type=${@dict.getType('cwsk_coopera_status')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">给量比例：</label>
                <div class="col-sm-8">
                    <input name="rechargeRate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">CPS查看充值记录。0：不允许，1：允许：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('cwsk_special_power')}">
                        <input type="radio" th:id="${'rechargeRecordView_' + dict.dictCode}" name="rechargeRecordView" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'rechargeRecordView_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">子渠道用户ID：</label>
                <div class="col-sm-8">
                    <input name="subUserId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">子渠道分成比例：</label>
                <div class="col-sm-8">
                    <input name="subRate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">子渠道ID：</label>
                <div class="col-sm-8">
                    <input name="subChannelId" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "cwsk/package"
        $("#form-package-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-package-add').serialize());
            }
        }
    </script>
</body>
</html>